package com.nutricia.common.condition;

/**
 * 统一分页参数
 *
 * @author: huangsheng
 * @date: 2017 /10/19
 */
public class PageBaseCondition {


    /**
     * 展现的页数下标
     */
    private int pageIndex;

    /**
     * 每页显示数据的长度
     */
    private int pageSize;

    /**
     * 开始查询的数据下标
     */
    private int start;

    public PageBaseCondition(int pageIndex, int pageSize) {
        this.pageIndex = pageIndex;
        this.pageSize = pageSize;
        this.start = (pageIndex - 1) * pageSize;
    }

    /**
     * Gets page index.
     *
     * @return the page index
     */
    public int getPageIndex() {
        return pageIndex;
    }

    /**
     * Sets page index.
     *
     * @param pageIndex the page index
     */
    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    /**
     * Gets page size.
     *
     * @return the page size
     */
    public int getPageSize() {
        return pageSize;
    }

    /**
     * Sets page size.
     *
     * @param pageSize the page size
     */
    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
}
